package broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import com.example.administrator.baseproject.BaseActivity;
import baseinterface.NetChangeDeal;
import utils.NetUtil;

public class NetBroadCastReceiver extends BroadcastReceiver {
    public NetChangeDeal netChangeDeal;

    @Override
    public void onReceive(Context context, Intent intent) {
        netChangeDeal= BaseActivity.netChangeDeal;
        if (intent.getAction().equals(ConnectivityManager.CONNECTIVITY_ACTION)) {
            // 接口回调传过去状态的类型
            netChangeDeal.onNetChange(NetUtil.getNetWorkState(context));
        }
    }
}
